First, prefaceSince innertext is not a standard property, we cannot use it in Firefox, and we can generally use textcontent instead, but can it be exactly the same? Is it still weird in the form elements of the pit daddy (such as input, textarea,
First, prefaceSince innertext is not a standard property, we cannot use it in Firefox, and we can generally use textcontent instead, but can it be exactly the same? Is it still weird in the form elements of the pit daddy (such as input, textarea,
Create a new document, input the content, and rename it ".
1:Textarea ID= "QQ"> Textarea>
2:Script>
3:// Document. getelementbyid ("QQ"). value = '000000 ';
4:Document. getelementbyid ("QQ"). Innerhtml ='Sfsdfsdfsfaf';
5:Document.
1. In JavaScript, first let's see that innerHTML and innertext can be used to get the contents of a DOM element.
We can write this:
(1) When using innertext
In JS we,
The results obtained are as follows:
(2) when using innerHTML
Run this code
Path to full-stack JavaScript (19th) html 5 insertion of html tags (1) innerHTML and outerHTML, html5outerhtml
It is difficult to use DOM operations to insert a large number of html tags to a document. You must not only create a series of nodes, but
The IE6-IE9 in the tbody innerHTML can not assign a value to the solution, ie6-ie9tbody
The innerHTML of tbody in the IE6-IE9 cannot be assigned a value. The reproduction code is as follows:
Js Code
innerHTML of tbody in IE6-IE9 cannot copy bugs
The innerHTML of tbody in the IE6-IE9 cannot be assigned a value. The reproduction code is as follows:Copy codeThe Code is as follows: innerHTML of tbody in IE6-IE9 cannot copy bug aaa GET SET Two buttons: the first to get the innerHTML of
IE6/IE7/IE8/IE9 tbody innerHTML cannot be assigned, reproduce the code as follows
Copy the Code code as follows:
Tbody innerHTML in IE6-IE9 cannot copy a bug
Aaa
GET SET
Two buttons, the first to get Tbody's
In javascript, if we want to obtain the object content, js provides three methods for us: outerhtml, innerhtml, and innertext. But what is the difference between them and their specific usage, A lot of people may not know how to use innerHTML,
Recently, it was found that all major libraries can use xxx. innerHTMLHTML fragments to generate node elements, and then insert them into each position of the target element. This is actually insertAdjacentHTML, but the nasty innerHTML of IE turns
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.